package edu.qqcui.study.service;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

import org.springframework.web.context.request.async.DeferredResult;

/**
 * TODO
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2021-06-27 21:49
 **/
public class DeferredResultQueue {

	private static Queue<DeferredResult<Object>> queue = new ConcurrentLinkedQueue<DeferredResult<Object>>();

	public static void save(DeferredResult<Object> deferredResult){
		queue.add(deferredResult);
	}

	public static DeferredResult<Object> get( ){
		return queue.poll();
	}
}
